package d0319;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file=new File("src/d0319/test.txt");
        System.out.println("文件是否存在: "+file.exists());
        System.out.println("判断是否为文件: "+file.isFile());
        System.out.println("判断是否为目录: "+file.isDirectory());
        System.out.println("获得文件名称: "+file.getName());
        System.out.println("获得绝对路径: "+file.getAbsolutePath());
        System.out.println("获得文件长度: "+file.length());
        System.out.println("获得文件数组: "+file.listFiles());
        System.out.println("删除文件: "+file.delete());
    }
}
